import request from '@/utils/request'

export function fetchResearchGroupList() {
  return request({
    url: '/researchgroups',
    method: 'get'
  })
}

export function fetchResearchGroupById(id) {
  return request({
    url: `/researchgroups/${id}`,
    method: 'get'
  })
}

export function fetchResearchGroupsByUserId(id) {
  return request({
    url: `/researchgroups/my/${id}`,
    method: 'get'
  })
}

export function createResearchGroup(data) {
  return request({
    url: '/researchgroups',
    method: 'post',
    data
  })
}

export function updateResearchGroup(id, data) {
  return request({
    url: `/researchgroups/${id}`,
    method: 'put',
    data
  })
}

export function deleteResearchGroup(id) {
    return request({
      url: `/researchgroups/${id}`,
      method: 'delete'
    })
}
  
